package cn.tedu.mall.producer.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

import static cn.tedu.mall.producer.pojo.validation.BrandValidationConst.MESSAGE_PINYIN;
import static cn.tedu.mall.producer.pojo.validation.BrandValidationConst.REGEXP_PINYIN;


/**
 * 添加品牌的DTO类
 *
 * @author java@tedu.cn
 * @version 0.0.1
 */
@Data
public class BrandAddNewDTO implements Serializable {

    /**
     * 类别id
     */
    @ApiModelProperty(value = "类别id", required = true, example = "0")
    private Long categoryId;

    /**
     * 品牌名称
     */
    @ApiModelProperty(value = "品牌名称", required = true, example = "华为")
    @NotBlank(message = "请填写有效的品牌名称")
    private String name;

    /**
     * 品牌名称的拼音
     */
    @ApiModelProperty(value = "品牌名称的拼音", required = true, example = "huawei")
    @NotNull(message = "请提交品牌名称的拼音")
    @Pattern(regexp = REGEXP_PINYIN, message = MESSAGE_PINYIN)
    private String pinyin;

    /**
     * 品牌logo的URL
     */
    @ApiModelProperty(value = "品牌logo的URL", example = "http://www.logo.com/huawei.png")
    private String logo;

    /**
     * 品牌简介
     */
    @ApiModelProperty(value = "品牌简介", example = "专注网络技术几十年")
    private String description;

    /**
     * 关键词列表，各关键词使用英文的逗号分隔
     */
    @ApiModelProperty(value = "关键词列表，各关键词使用英文的逗号分隔", example = "华为,Mate,Nova")
    @NotNull(message = "请提交关键词列表")
    private String keywords;

    /**
     * 自定义排序序号
     */
    @ApiModelProperty(value = "自定义排序序号", example = "98")
    @NotNull(message = "请提交自定义排序序号")
    @Range(max = 99, message = "自定义排序序号必须是0~99之间数字")
    private Integer sort;

}